class Error:
    def __init__(self, code, message):
        self.code = code
        self.message = message


class NotFound(Error):
    def __init__(self):
        super().__init__(404, "没有该数据")


def errorToJson(err: Error):
    return {"code": err.code, "message": err.message}
